using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._ManageData
{
    /// <summary>
    /// <para>Convert Raster To Feature</para>
    /// <para>Converts a raster to a feature dataset as points, lines, or polygons.</para>
    /// <para>将栅格转换为点、线或面的要素数据集。</para>
    /// </summary>    
    [DisplayName("Convert Raster To Feature")]
    public class ConvertRasterToFeature : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ConvertRasterToFeature()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputRaster">
        /// <para>Input Raster Layer</para>
        /// <para>The input raster layer.</para>
        /// <para>输入栅格图层。</para>
        /// </param>
        /// <param name="_outputName">
        /// <para>Output Name</para>
        /// <para>The output feature class that will contain the converted points, lines, or polygons.</para>
        /// <para>将包含转换后的点、线或面的输出要素类。</para>
        /// </param>
        public ConvertRasterToFeature(object _inputRaster, object _outputName)
        {
            this._inputRaster = _inputRaster;
            this._outputName = _outputName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Convert Raster To Feature";

        public override string CallName => "ra.ConvertRasterToFeature";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "snapRaster"];

        public override object[] ParameterInfo => [_inputRaster, _field, _outputType.GetGPValue(), _simplifyLinesOrPolygons.GetGPValue(), _outputName, _outputFeatures, _createMultipartFeatures.GetGPValue(), _maxVerticesPerFeature];

        /// <summary>
        /// <para>Input Raster Layer</para>
        /// <para>The input raster layer.</para>
        /// <para>输入栅格图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputRaster { get; set; }


        /// <summary>
        /// <para>Field</para>
        /// <para><xdoc>
        ///   <para>A field that specifies the conversion value.</para>
        ///   <para>It can be any integer or text value.</para>
        ///   <para>A field containing floating-point values can only be used if the output is to a point dataset.</para>
        ///   <para>The default is the Value field, which contains the value in each raster cell.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定转化值的字段。</para>
        ///   <para>它可以是任何整数或文本值。</para>
        ///   <para>仅当输出为点数据集时，才能使用包含浮点值的字段。</para>
        ///   <para>默认值为 Value 字段，其中包含每个栅格像元中的值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field { get; set; } = null;


        /// <summary>
        /// <para>Output Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the output type.</para>
        ///   <bulletList>
        ///     <bullet_item>Point—The raster will be converted to a point dataset. This is the default.</bullet_item><para/>
        ///     <bullet_item>Line—The raster will be converted to a line feature dataset.</bullet_item><para/>
        ///     <bullet_item>Polygon—The raster will be converted to a polygon feature dataset.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>If the output type is Line or Polygon, an additional parameter appears allowing the simplification of lines or polygons.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出类型。</para>
        ///   <bulletList>
        ///     <bullet_item>点—栅格将转换为点数据集。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>线 - 栅格将转换为线要素数据集。</bullet_item><para/>
        ///     <bullet_item>面—栅格将转换为面要素数据集。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>如果输出类型为线或多边形，则会显示一个附加参数，允许简化直线或多边形。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _outputType_value _outputType { get; set; } = _outputType_value._POINT;

        public enum _outputType_value
        {
            /// <summary>
            /// <para>Point</para>
            /// <para>Point—The raster will be converted to a point dataset. This is the default.</para>
            /// <para>点—栅格将转换为点数据集。这是默认设置。</para>
            /// </summary>
            [Description("Point")]
            [GPEnumValue("POINT")]
            _POINT,

            /// <summary>
            /// <para>Line</para>
            /// <para>Line—The raster will be converted to a line feature dataset.</para>
            /// <para>线 - 栅格将转换为线要素数据集。</para>
            /// </summary>
            [Description("Line")]
            [GPEnumValue("LINE")]
            _LINE,

            /// <summary>
            /// <para>Polygon</para>
            /// <para>Polygon—The raster will be converted to a polygon feature dataset.</para>
            /// <para>面—栅格将转换为面要素数据集。</para>
            /// </summary>
            [Description("Polygon")]
            [GPEnumValue("POLYGON")]
            _POLYGON,

        }

        /// <summary>
        /// <para>Simplify Lines or Polygons</para>
        /// <para><xdoc>
        ///   <para>Specifies whether lines or polygons will be simplified (smoothed). The smoothing is done in such a way that the line contains a minimum number of segments while remaining as close as possible to the original raster cell edges.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The line or polygon features will be smoothed to produce a more generalized result. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The line or polygon features will not be smoothed and will follow the cell boundaries of the raster dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否要简化（平滑）直线或多边形。平滑处理的方法是，线条包含最少数量的线段，同时尽可能靠近原始栅格像元边缘。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将平滑线或面要素以生成更通用的结果。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 线或面要素将不会被平滑处理，并将遵循栅格数据集的像元边界。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplify Lines or Polygons")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _simplifyLinesOrPolygons_value _simplifyLinesOrPolygons { get; set; } = _simplifyLinesOrPolygons_value._true;

        public enum _simplifyLinesOrPolygons_value
        {
            /// <summary>
            /// <para>SIMPLIFY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SIMPLIFY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SIMPLIFY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SIMPLIFY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Name</para>
        /// <para>The output feature class that will contain the converted points, lines, or polygons.</para>
        /// <para>将包含转换后的点、线或面的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputName { get; set; }


        /// <summary>
        /// <para>Output Feature</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputFeatures { get; set; }


        /// <summary>
        /// <para>Create Multipart Features</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output polygons will consist of single-part or multipart features.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked— Multipart features will be created based on polygons that have the same value.</bullet_item><para/>
        ///     <bullet_item>Unchecked— Individual (single-part) features will be created for each polygon. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出面是由单部分要素还是多部分要素组成。</para>
        ///   <bulletList>
        ///     <bullet_item>选中- 将基于具有相同值的面创建多部分要素。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将为每个面创建单独的（单部分）要素。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Create Multipart Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _createMultipartFeatures_value _createMultipartFeatures { get; set; } = _createMultipartFeatures_value._false;

        public enum _createMultipartFeatures_value
        {
            /// <summary>
            /// <para>MULTIPLE_OUTER_PART</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MULTIPLE_OUTER_PART")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>SINGLE_OUTER_PART</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SINGLE_OUTER_PART")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Maximum Vertices Per Polygon Feature</para>
        /// <para><xdoc>
        ///   <para>The vertex limit used to subdivide a polygon into smaller polygons. This parameter produces similar output as that created by the Dice tool in the Data Management toolbox.</para>
        ///   <para>If left empty, the output polygons will not be split. This is the default.</para>
        ///   <para>This parameter is only supported if Output Type is Polygon.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于将多边形细分为更小多边形的顶点限制。此参数生成的输出与数据管理工具箱中的骰子工具创建的输出类似。</para>
        ///   <para>如果留空，则不会拆分输出多边形。这是默认设置。</para>
        ///   <para>仅当输出类型为多边形时，才支持此参数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Vertices Per Polygon Feature")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _maxVerticesPerFeature { get; set; } = null;


        public ConvertRasterToFeature SetEnv(object extent = null, object outputCoordinateSystem = null, object snapRaster = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, snapRaster: snapRaster);
            return this;
        }

    }

}